package com.chinackts.common.utils;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * @author Lianhong
 * @since 2021/2/21
 */
public class ErrorMsgUtil {

    public static String getErrorMsg(Throwable t) {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        t.printStackTrace(pw);
        pw.flush();
        sw.flush();
        return sw.toString();
    }

}
